home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / packet / p_aa4re / bb212src / bbfwdsrv.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1992-02-05  |  3.3 KB  |  78 lines

  1. (*===========================================================================*)
  2. (* Forward task -- Reverse forward                                           *)
  3. (*                                                                           *)
  4. (*   Copyright 1988, 1989 by H. Roy Engehausen.  All rights reserved.        *)
  5. (*                                                                           *)
  6. (*===========================================================================*)
  7.  
  8. (*===========================================================================*)
  9. (* Forward rev... See if other end has any mail for me                       *)
  10. (*===========================================================================*)
  11.  
  12. PROCEDURE forward_rev(path_common : path_block_ptr);
  13.  
  14.   VAR
  15.     i      : WORD;
  16.     t_str  : STRING;
  17.  
  18.   BEGIN;
  19.  
  20.     (*-----------------------------------------------------------------------*)
  21.     (* Ensure that the error switch is off and reverse forward is on         *)
  22.     (*-----------------------------------------------------------------------*)
  23.  
  24.     active_tcb^.error_sw    := FALSE;
  25.     active_tcb^.tcb_rev_fwd := TRUE;
  26.  
  27.     (*-----------------------------------------------------------------------*)
  28.     (* Loop forever -- There is no exit from this block                      *)
  29.     (*-----------------------------------------------------------------------*)
  30.  
  31.     WHILE TRUE DO
  32.       BEGIN;
  33.  
  34.         (*-------------------------------------------------------------------*)
  35.         (* Send the prompt                                                   *)
  36.         (*-------------------------------------------------------------------*)
  37.  
  38.         send_tnc_data_str('F>' + cr);
  39.  
  40.         (*-------------------------------------------------------------------*)
  41.         (* Read the reply                                                    *)
  42.         (*-------------------------------------------------------------------*)
  43.  
  44.         t_str := upcase_str(read_tnc_data_str);
  45.         strip_crlf(t_str);
  46.  
  47.         (*-------------------------------------------------------------------*)
  48.         (* If it ain't a send command, dump the session                      *)
  49.         (*-------------------------------------------------------------------*)
  50.  
  51.         IF (LENGTH(t_str) < 3) OR (words(t_str) = 0) OR (t_str[1] <> 'S')
  52.                  OR ((t_str[2] <> ' ') AND (t_str[3] <> ' ')) THEN
  53.           BEGIN;
  54.             path_common^.path_delay := FALSE;
  55.             end_session(TRUE);
  56.           END;
  57.  
  58.         (*-------------------------------------------------------------------*)
  59.         (* Handle send command                                               *)
  60.         (*-------------------------------------------------------------------*)
  61.  
  62.         send_msg_cmd(t_str);
  63.         active_tcb^.tcb_rcv_msg := FALSE;
  64.  
  65.         (*-------------------------------------------------------------------*)
  66.         (* If an error, dump the session.                                    *)
  67.         (*-------------------------------------------------------------------*)
  68.  
  69.         IF active_tcb^.error_sw THEN
  70.           BEGIN;
  71.             path_common^.path_delay := FALSE;
  72.             end_session(TRUE);
  73.           END;
  74.  
  75.       END; (*----- End reverse forwarding loop ------------------------------*)
  76.  
  77.   END;
  78.